home *** CD-ROM | disk | FTP | other *** search
- /***************************************************** IMPLEMENTATION
- DATE: 10/24/93
- AUTHOR: Eric R. Rosé
-
- CLASS: CPPVisualTree
-
- SUPERCLASS: CPPTree
-
- This C++ class handles the display of a tree
-
- ********************************************************************/
-
- #pragma once
-
- #include <CPPTree.h>
- #include <CPPVisualTreeNode.h>
-
- class CPPVisualTreeNode;
-
- class CPPVisualTree : public CPPTree {
- public:
- CPPObject *lastClicked;
- Boolean forceDraw;
-
- CPPVisualTree (WindowPtr itsWindow,
- Point newTopLeft,
- orientStyle orientation = kTopDown,
- justStyle justification = kJustCenter,
- joinTypes join = kRightAngle,
- short branchLength = 25);
- ~CPPVisualTree (void);
-
- virtual Boolean Member (char *className);
- virtual char *ClassName (void);
-
- void Prepare (CPPObject *caller);
- void Restore (CPPObject *caller);
-
- void ForceRedraw (Boolean doErase);
- void ForceResize (Boolean doDraw);
- void DrawAllJoins (Boolean doDraw);
- void ForceMove (Boolean doDraw, Point topLeft);
- void AdjustTree (void);
-
- void DrawDefaultJoin (CPPVisualTreeNode *FromNode,
- CPPVisualTreeNode *ToNode);
-
- void SetOrientation (orientStyle newOrient);
- void SetJustification (justStyle newJust);
- void SetJoinType (joinTypes newJoin);
- void SetBranchLength (short newLength);
- void SetNodeMargin (short newMargin);
-
- inline orientStyle GetOrientation (void) { return this->orientation;}
- inline justStyle GetJustification (void) { return this->justification;}
- inline joinTypes GetJoinType (void) { return this->whichJoin;}
- inline short GetBranchLength (void) { return this->branchLength;}
- inline short GetNodeMargin (void) { return this->nodeMargin;}
-
- virtual void Draw (void);
-
- virtual Boolean DoCommand (short commandID);
-
- virtual Boolean DoTreeClick (EventRecord *theEvent);
- virtual void DoCut (void);
- virtual void DoCopy (void);
- virtual void DoPaste (void);
- virtual void DoClear (void);
- virtual void DoSelectAll (void);
-
- void GetTreeBounds (Rect *itsBounds);
- PicHandle GetTreePicture (Boolean asQDPICT, Boolean placeInClipboard);
-
- protected:
- WindowPtr theWindow;
- Point topLeft;
-
- Boolean isPrepared;
- CPPObject *preparedBy;
- GrafPtr SavePort;
-
- long lastClickTime;
-
- orientStyle orientation;
- justStyle justification;
- joinTypes whichJoin;
- short branchLength;
- short nodeMargin;
-
- virtual void UserSpecificPrepare (void);
- virtual void UserSpecificRestore (void);
- virtual void DrawPoint2Point (Point FromPt, Point ToPt);
- virtual void DrawRightAngle (Point FromPt, Point ToPt,
- orientStyle orientation);
-
- };